<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<jsp:include page="/order/include/base_order_pre_part.jsp"></jsp:include>
<script type="text/javascript">
var orderId = "<s:property value="orderId" />";
</script>
<script language="javascript" src="<%=request.getContextPath()%>/order/js/selectProduct.js" type="text/javascript"></script>
<div>
	<table width="100%">
		<tr>
			<td class="key">
				订单编号:
			</td>
			<td>
				<a href="<%=request.getContextPath()%>/order/viewOrder.do?id=<s:property value="order.id" />" target="_blank"> <s:property value="order.id" /> </a>
				<s:hidden value="orderId" />
			</td>
		</tr>
		<tr>
			<td class="key">
				订单标题:
			</td>
			<td>
				<s:property value="order.title" />
			</td>
		</tr>
		<tr>
			<td class="key">
				订单类别:
			</td>
			<td>
				<s:property value="order.category.chainName" />
			</td>
		</tr>
	</table>

</div>
<DIV class="box_blue">
	<div class="box_title">
		选择商品/服务
	</div>
	<div>
		<input type="button" value="确定" class="btn_blue_3" onclick="javascript:submitProductSelect();" /><br/>
		所选择商品/服务：
		<input name="productId" id="productId" type="hidden" />
		<span id="productName" class="show_selected"></span>
	</div>
	<div>
		产品列表
		<input type="button" value="刷新列表" onclick="javascript:window.location.reload();" class="hidden" />
		<input type="button" value="添加" onclick="javascript:showProductBox()" id="btnAddProduct" class="hidden" />
		(请点击产品名称后面的"选择"按钮选中商品/服务)
		<div style="display: none;" id="productBox">
			<table width="100%">
				<s:hidden name="product.id" />
				<s:hidden name="product.category.id" value="%{order.category.id}" />
				<tr>
					<td class="tdLabel">
						<s:text name="category" />
					</td>
					<td>
						<s:property value="order.category.chainName" />
					</td>
				</tr>
				<s:textfield name="product.name" label="%{getText('name')}" />
				<s:textarea name="product.introduction" label="%{getText('introduction')}" rows="7" cssStyle="width:400px;" />
			</table>
			<input type="button" value="添加" onclick="javascript:postNewProduct();">
			<input type="button" value="取消" onclick="javascript:hideProductBox();">
		</div>

		<ol>
			<s:iterator value="products" status="status">
				<li style="display: block;" productId="<s:property value="id"/>">
					<a href="<%=request.getContextPath()%>/product/viewProduct.do?id=<s:property value="id" />" target="_blank"> <s:property value="name" /> </a> 
					<input type="button" onclick="javascript:setProduct('<s:property value="id"/>','<s:property value="name"/>');" value="选择" />
				</li>
			</s:iterator>
		</ol>
	</div>

</DIV>

<input type="button" value="确定" class="btn_blue_3" onclick="javascript:submitProductSelect();" />


<jsp:include page="/order/include/base_order_last_part.jsp"></jsp:include>